<HTML><HEAD><TITLE>record(+Key, ?Value)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Recorded Database</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>record(+Key, ?Value)</H1>
Records the term Value at the end of key Key in the indexed database.


<DL>
<DT><EM>Key</EM></DT>
<DD>An atom, compound term, or handle.
</DD>
<DT><EM>Value</EM></DT>
<DD>Any prolog term.
</DD>
</DL>
<H2>Description</H2>
   Used to record any prolog term Value at the end of the indexed database
   entry associated with the key Key.  A synonym for recordz/2.  In the
   case of compound terms, all keys of the same name and arity are treated
   as equal.

<P>
   If backtracking occurs through the call of record/2 the associated Value
   is not removed from the indexed database.  Recording the same Value
   twice results in two identical entries in the indexed database.  All
   variables are recorded according to their internal representations.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>record(+, ?) is det
</UL>
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Key is not instantiated.
<DT><EM>(5) type error </EM>
<DD>Key is neither an atom nor a compound term.
</DL>
<H2>Examples</H2>
<PRE>
   Success:
    record(a(compound,term),value1).
    record([a,different,term],value2).

    [eclipse]: record(whiskey,jameson),
    &gt;        record(whiskey,glenlivet),
    &gt;        record(whiskey,bushmills).
    yes.
    [eclipse]: recorded(whiskey,Value).
    Value = jameson     More (;)
    Value = glenlivet     More (;)
    Value = bushmills     More (;)
    no (more) solution.
Error:
    record(Key, anything).             (Error 4)
    record("key",anything).            (Error 5)



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/record/recorda-2.html">recorda / 2</A>, <A HREF="../../kernel/record/recordz-2.html">recordz / 2</A>
</BODY></HTML>
